//
//  UIView+WDLExtension.m
//  GuideInternalPurchase
//
//  Created by 王亮 on 2021/1/12.
//  Copyright © 2021 GuideInternalPurchase. All rights reserved.
//

#import "UIView+WDLExtension.h"

@implementation UIView (WDLExtension)
- (UIViewController *)wl_viewController {
    UIView* superView = self;
    while (superView)
    {
        UIResponder *nextResponder = [superView nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]])
            return (UIViewController *)nextResponder;
        else
            superView = superView.superview;
    }
    return nil;
}
@end
